\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{uniudtesi}[2009/11/26  Redefines maketitle for University of Udine Thesis, and sets a binding offset of 1cm; written by Gianluca Gorni]
\RequirePackage{ifthen}
\RequirePackage{graphicx}
\RequirePackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Per allontanare la parte stampata %
% dal margine della rilegatura:     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[bindingoffset=1cm]{geometry}


\hypersetup{pdfpagelayout=SinglePage,
pdfpagemode=UseOutlines,
bookmarksopen,
bookmarksopenlevel=2,
pdftitle=Relazione,
pdfauthor=Tesista,
pdfsubject=Tesi di Laurea,
pdfkeywords=tesi laurea LaTeX}

\newcommand{\@facolta}{Scienze
    Matematiche, Fisiche e Naturali}
\newcommand{\@corsodilaurea}{?}
\newcommand{\@corsodilaureatriennale}{?}
\newcommand{\@corsodilaureaspecialistica}{?}
\newcommand{\@triennaleOspecialistica}{?}
\newcommand{\@titolo}{Senza Titolo}
\newcommand{\@sottotitolo}{?}
\newcommand{\@annoaccademico}{?}
\newcommand{\@relatore}{}
\newcommand{\@correlatore}{?}
\newcommand{\@correlatoreDue}{?}
\newcommand{\@laureando}{?}
\newcommand{\@laureanda}{?}
\newcommand{\@autore}{}
\newcommand{\@laureandoOlaureanda}{?}
\newcommand{\@dedica}{?}

\newcommand{\facolta}[1]{%
  \renewcommand{\@facolta}{#1}}
\newcommand{\corsodilaurea}[1]{%
  \renewcommand{\@corsodilaurea}{#1}%
  \renewcommand{\@triennaleOspecialistica}{\ignorespaces}}
\newcommand{\corsodilaureatriennale}[1]{%
  \renewcommand{\@corsodilaurea}{#1}%
  \renewcommand{\@triennaleOspecialistica}{Triennale }}
\newcommand{\corsodilaureaspecialistica}[1]{%
  \renewcommand{\@corsodilaurea}{#1}%
  \renewcommand{\@triennaleOspecialistica}{Magistrale }}
\newcommand{\titolo}[1]{%
  \renewcommand{\@titolo}{\uppercase{#1}}}
\newcommand{\sottotitolo}[1]{%
  \renewcommand{\@sottotitolo}{\uppercase{#1}}}
\newcommand{\annoaccademico}[1]{%
  \renewcommand{\@annoaccademico}{#1}}
\newcommand{\relatore}[2][Prof.]{%
  \renewcommand{\@relatore}{#1 \uppercase{#2}}}
\newcommand{\correlatore}[2][Prof.]{%
  \renewcommand{\@correlatore}{#1 \uppercase{#2}}}
\newcommand{\correlatoreDue}[2][Prof.]{%
  \renewcommand{\@correlatoreDue}{#1 \uppercase{#2}}}
\newcommand{\laureando}[1]{%
  \renewcommand{\@laureando}{\uppercase{#1}}%
  \renewcommand{\@autore}{\uppercase{#1}}%
  \renewcommand{\@laureandoOlaureanda}{Laureando}}
\newcommand{\laureanda}[1]{%
  \renewcommand{\@laureanda}{\uppercase{#1}}%
  \renewcommand{\@autore}{\uppercase{#1}}%
  \renewcommand{\@laureandoOlaureanda}{Laureanda}}
\newcommand{\dedica}[1]{%
  \renewcommand{\@dedica}{#1}}
\newcommand{\data}[1]{\date{#1}}

\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}%
  \cleardoublepage}}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %                                   %
    %  Formattazione dell'intestazione  %
    %  della tesi                       %
    %                                   %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand\maketitle{\begin{titlepage}
  \begin{sffamily}
  \begin{large}
  \begin{center}
    %\vbox to0pt
    %%{%
  %%  \vbox to\textheight{\vfil
    \includegraphics[width=24mm]{logounivaq}%
   %% \vfil}\vss}
  \end{center}
  \begin{center}
  \begin{Large}
    \uppercase{Universit\`a degli Studi di L'Aquila}
    \end{Large}\\
  \rule{9cm}{.4pt}\\
  \smallskip
  Facolt\`a di \@facolta\\
  \medskip
  Corso di Laurea \@triennaleOspecialistica in
     \@corsodilaurea\\
  \bigskip\vfill
  \begin{Large} Breve Relazione\end{Large}\\
  \bigskip
  \bigskip
  {\vfil
    \begin{Huge}
      {\renewcommand{\\}{\cr}
     \halign{\hbox to\textwidth{\strut\hfil##\hfil}\cr
     \@titolo\cr}}
    \end{Huge}%
    \begin{LARGE}
      {\renewcommand{\\}{\cr}
      \ifthenelse{\equal{\@sottotitolo}{?}}{}%
     {\bigskip
     \halign{\hbox to\textwidth{\strut\hfil##\hfil}\cr
     \@sottotitolo\cr}}}
    \end{LARGE}}
  \bigskip\vfill
  \begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}l@{}}
   
     \vtop{\halign{\strut\hfil##\hfil\cr
       \@relatore\cr}}&%
     \vtop{\halign{\strut\hfil##\hfil\cr
       \@autore\cr}}%
  \end{tabular*}\end{center}

  \begin{center}
  \vfill
  \rule{9cm}{.4pt}\\
  \medskip
  \uppercase{Anno Accademico \@annoaccademico}\\
  \end{center}
  \end{large}
\end{sffamily}
\clearemptydoublepage
\ifthenelse{\equal{\@dedica}{?}}{}{%
\pagestyle{empty}
  \null\vfil
  \begin{Large}
  \begin{flushright}
    \@dedica
  \end{flushright}
  \end{Large}
  \vfil\vfil\clearemptydoublepage}
\end{titlepage}}


\endinput